@import '../style/theme/color';
@import '../style/core/_font';
@import '../style/core/animation';
@import '../style/theme/corner';

.devui-dropdown-menu {
  padding-bottom: 0;
}

.devui-dropdown-item {
  height: 32px;
  padding: 8px 12px;
}

.devui-dropdown-open {
  input {
    border: 1px solid $devui-brand;

    &::-webkit-input-placeholder {
      color: $devui-text;
    }
  }

  .devui-drop-icon {
    svg {
      transform: rotate(180deg);
    }
  }

  .devui-tags-input-wrapper {
    border-color: $devui-brand;
    border-radius: $devui-border-radius;
  }
}

.devui-input {
  padding-right: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: default;
}

.devui-search-cascader {
  cursor: text;
}

.devui-cascader-list {
  border-left: 1px solid $devui-dividing-line;
  height: 180px;
  overflow-y: auto;
  overflow-y: overlay;
  display: inline-block;
  font-size: $devui-font-size;

  &:first-of-type {
    border-left: none;
  }

  &-item {
    height: 32px;
    padding: 8px 12px;
    cursor: pointer;
    display: block;

    &:hover {
      background-color: $devui-list-item-hover-bg;
      color: $devui-link;
    }
  }

  .active-li {
    background-color: $devui-list-item-hover-bg;
    color: $devui-link;
  }
}

::ng-deep {
  .devui-dropdown-top .devui-cascader-list {
    border-top-color: $devui-brand !important;
    border-bottom-color: $devui-dividing-line !important;
    box-shadow: unset;
  }
}

.devui-drop-no-data {
  height: auto;
  display: block;
}

.devui-drop-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  line-height: 1em;
  vertical-align: middle;

  svg path {
    fill: $devui-text;
  }

  &-animation svg {
    transition: transform $devui-animation-duration-slow $devui-animation-ease-in-out-smooth;
  }
}

.devui-cascader-close-icon {
  display: none;
  font-size: $devui-font-size-icon;
  cursor: pointer;
  width: 12px;
  height: 12px;
  line-height: 12px;
  background-color: $devui-line;
  border-radius: 50%;
  text-align: center;

  svg path {
    fill: $devui-light-text;
  }
}

.dropdown-show-clear {
  &:hover {
    .devui-drop-icon {
      display: none;
    }

    .devui-cascader-close-icon {
      display: block;
    }
  }
}

.devui-single-drop-icon-wrapper {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 4px;
  width: 1em;
  display: flex;
}

.devui-tags-input-wrapper {
  border: 1px solid $devui-line;
  display: inline-flex;
  width: 100%;
  border-radius: $devui-border-radius;

  .devui-tags-input {
    flex: 1;
    min-height: 26px;
    max-height: 56px;
    overflow: auto;
    padding: 1px 0 1px 4px;

    d-tag {
      margin-right: 4px;
      margin-bottom: 2px;
      margin-top: 2px;
    }
  }

  .devui-drop-icon-wrapper {
    flex: 0 0 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .inner-input {
    max-width: 150px;
    height: 21px;
    border: none;
    outline: 0;
    background: $devui-base-bg;
    color: $devui-text;
    padding: 0 8px;
  }

  &:hover {
    border-color: $devui-aide-text;
  }
}

.devui-dropdown-placeholder {
  line-height: 22px;
  margin-left: 8px;
  color: $devui-placeholder;
}

.devui-drop-menu-wrapper {
  white-space: nowrap;
  font-size: 0;
}
